@page "/DualLine_Combo_Chart"
@inject IJSRuntime JS;

<DualAxes Data="@(new object[] { data1, data2 })" Config="config1" />

<Divider>动手实验</Divider>
<DynamicExample @ref="@example">
    <DualAxes @ref="@chart" />
</DynamicExample>

@code{

    public IChartComponent chart;
    DynamicExample example;

    protected override void OnAfterRender(bool firstRender)
    {
        base.OnAfterRender(firstRender);
        example.Chart = chart;
    }


    #region 示例1

    object data1 = new object[]{
        new { year = "1991", value = 3 },
        new  { year= "1992", value= 4 },
        new  { year= "1993", value= 3.5 },
        new  { year= "1994", value= 5 },
        new  { year= "1995", value= 4.9 },
        new  { year= "1996", value= 6 },
        new  { year= "1997", value= 7 },
        new  { year= "1998", value= 9 },
        new  { year= "1999", value= 13 },
            };

    object data2 = new object[]{
        new   { year = "1991", count = 10 },
        new   { year= "1992", count= 4 },
        new   { year= "1993", count= 5 },
        new   { year= "1994", count= 5 },
        new   { year= "1995", count= 4.9 },
        new  { year= "1996", count= 35 },
        new  { year= "1997", count= 7 },
        new  { year= "1998", count= 1 },
        new  { year= "1999", count= 20 },
            };

    DualAxesConfig config1 = new DualAxesConfig()
    {
        XField = "year",
        YField = new string[] { "value", "count" },
        GeometryOptions = new object[] {
        new {
            Geometry= "line",
                    Color= "#5B8FF9",
                },

        new {
                Geometry= "line",
                Color= "#5AD8A6",
            },
        },

    };

    #endregion 示例1

}


